<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.6"/>
<title>Paho C++: src/mqtt/message.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="pahologo.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">Paho C++
   &#160;<span id="projectnumber">1.0</span>
   </div>
   <div id="projectbrief">The Paho MQTT C++ Client Library</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.6 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('message_8h_source.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Friends</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">message.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="message_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;</div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment">/*******************************************************************************</span></div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment"> * Copyright (c) 2013-2017 Frank Pagliughi &lt;fpagliughi@mindspring.com&gt;</span></div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="comment"> * All rights reserved. This program and the accompanying materials</span></div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="comment"> * are made available under the terms of the Eclipse Public License v1.0</span></div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="comment"> * and Eclipse Distribution License v1.0 which accompany this distribution.</span></div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="comment"> * The Eclipse Public License is available at</span></div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="comment"> *    http://www.eclipse.org/legal/epl-v10.html</span></div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="comment"> * and the Eclipse Distribution License is available at</span></div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="comment"> *   http://www.eclipse.org/org/documents/edl-v10.php.</span></div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="comment"> * Contributors:</span></div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="comment"> *    Frank Pagliughi - initial implementation and documentation</span></div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="comment"> *******************************************************************************/</span></div>
<div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;</div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="preprocessor">#ifndef __mqtt_message_h</span></div>
<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define __mqtt_message_h</span></div>
<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;<span class="preprocessor">#include &quot;MQTTAsync.h&quot;</span></div>
<div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="buffer__ref_8h.html">mqtt/buffer_ref.h</a>&quot;</span></div>
<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="exception_8h.html">mqtt/exception.h</a>&quot;</span></div>
<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;<span class="preprocessor">#include &lt;memory&gt;</span></div>
<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;</div>
<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;<span class="keyword">namespace </span>mqtt {</div>
<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;</div>
<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;</div>
<div class="line"><a name="l00052"></a><span class="lineno"><a class="line" href="classmqtt_1_1message.html">   52</a></span>&#160;<span class="keyword">class </span><a class="code" href="classmqtt_1_1message.html">message</a></div>
<div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;{</div>
<div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00056"></a><span class="lineno"><a class="line" href="classmqtt_1_1message.html#a9689553c0840b987f5aa064b3692e09c">   56</a></span>&#160;    <span class="keyword">static</span> constexpr <span class="keywordtype">int</span> <a class="code" href="classmqtt_1_1message.html#a9689553c0840b987f5aa064b3692e09c">DFLT_QOS</a> = 0;</div>
<div class="line"><a name="l00058"></a><span class="lineno"><a class="line" href="classmqtt_1_1message.html#a4130d0db580fb11ee4a476712f000d48">   58</a></span>&#160;    <span class="keyword">static</span> constexpr <span class="keywordtype">bool</span> <a class="code" href="classmqtt_1_1message.html#a4130d0db580fb11ee4a476712f000d48">DFLT_RETAINED</a> = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;</div>
<div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;<span class="keyword">private</span>:</div>
<div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;    <span class="keyword">static</span> <span class="keyword">const</span> MQTTAsync_message DFLT_C_STRUCT;</div>
<div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;</div>
<div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;    <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">string</span> EMPTY_STR;</div>
<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;    <span class="keyword">static</span> <span class="keyword">const</span> binary EMPTY_BIN;</div>
<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;</div>
<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;    MQTTAsync_message msg_;</div>
<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;    <a class="code" href="classmqtt_1_1buffer__ref.html">string_ref</a> topic_;</div>
<div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;    <a class="code" href="classmqtt_1_1buffer__ref.html">binary_ref</a> payload_;</div>
<div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;</div>
<div class="line"><a name="l00077"></a><span class="lineno"><a class="line" href="classmqtt_1_1message.html#ac39954340d8b15edaa883af1bcfcf7ae">   77</a></span>&#160;    <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classmqtt_1_1async__client.html">async_client</a>;</div>
<div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;    <span class="keyword">friend</span> <span class="keyword">class </span>message_test;</div>
<div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;</div>
<div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;    <span class="keywordtype">void</span> set_duplicate(<span class="keywordtype">bool</span> dup) { msg_.dup = to_int(dup); }</div>
<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;</div>
<div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00088"></a><span class="lineno"><a class="line" href="classmqtt_1_1message.html#af207327d7802ed7133640d3c18921017">   88</a></span>&#160;    <span class="keyword">using</span> <a class="code" href="classmqtt_1_1message.html#af207327d7802ed7133640d3c18921017">ptr_t</a> = std::shared_ptr&lt;message&gt;;</div>
<div class="line"><a name="l00090"></a><span class="lineno"><a class="line" href="classmqtt_1_1message.html#a99c3bfaaac300457e9678b5d1be30a43">   90</a></span>&#160;    <span class="keyword">using</span> <a class="code" href="classmqtt_1_1message.html#a99c3bfaaac300457e9678b5d1be30a43">const_ptr_t</a> = std::shared_ptr&lt;const message&gt;;</div>
<div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;</div>
<div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;    <a class="code" href="classmqtt_1_1message.html#a3c82927ad233c393b30f28f376b9d1b0">message</a>();</div>
<div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;    <a class="code" href="classmqtt_1_1message.html#a3c82927ad233c393b30f28f376b9d1b0">message</a>(<a class="code" href="classmqtt_1_1buffer__ref.html">string_ref</a> <a class="code" href="classmqtt_1_1topic.html">topic</a>, <span class="keyword">const</span> <span class="keywordtype">void</span>* payload, <span class="keywordtype">size_t</span> len,</div>
<div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;            <span class="keywordtype">int</span> qos, <span class="keywordtype">bool</span> retained);</div>
<div class="line"><a name="l00115"></a><span class="lineno"><a class="line" href="classmqtt_1_1message.html#a2faf94bc3aaf3d8795d2be0933df7ce4">  115</a></span>&#160;    <a class="code" href="classmqtt_1_1message.html#a2faf94bc3aaf3d8795d2be0933df7ce4">message</a>(<a class="code" href="classmqtt_1_1buffer__ref.html">string_ref</a> <a class="code" href="classmqtt_1_1topic.html">topic</a>, <span class="keyword">const</span> <span class="keywordtype">void</span>* payload, <span class="keywordtype">size_t</span> len)</div>
<div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;        : <a class="code" href="classmqtt_1_1message.html">message</a>(std::move(topic), payload, len, <a class="code" href="classmqtt_1_1message.html#a9689553c0840b987f5aa064b3692e09c">DFLT_QOS</a>, <a class="code" href="classmqtt_1_1message.html#a4130d0db580fb11ee4a476712f000d48">DFLT_RETAINED</a>) {}</div>
<div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;    <a class="code" href="classmqtt_1_1message.html#a3c82927ad233c393b30f28f376b9d1b0">message</a>(<a class="code" href="classmqtt_1_1buffer__ref.html">string_ref</a> <a class="code" href="classmqtt_1_1topic.html">topic</a>, <a class="code" href="classmqtt_1_1buffer__ref.html">binary_ref</a> payload, <span class="keywordtype">int</span> qos, <span class="keywordtype">bool</span> retained);</div>
<div class="line"><a name="l00132"></a><span class="lineno"><a class="line" href="classmqtt_1_1message.html#a0297a011ab9002ab3fe71156db647da7">  132</a></span>&#160;    <a class="code" href="classmqtt_1_1message.html#a0297a011ab9002ab3fe71156db647da7">message</a>(<a class="code" href="classmqtt_1_1buffer__ref.html">string_ref</a> <a class="code" href="classmqtt_1_1topic.html">topic</a>, <a class="code" href="classmqtt_1_1buffer__ref.html">binary_ref</a> payload)</div>
<div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;        : <a class="code" href="classmqtt_1_1message.html">message</a>(std::move(topic), std::move(payload), <a class="code" href="classmqtt_1_1message.html#a9689553c0840b987f5aa064b3692e09c">DFLT_QOS</a>, <a class="code" href="classmqtt_1_1message.html#a4130d0db580fb11ee4a476712f000d48">DFLT_RETAINED</a>) {}</div>
<div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;    <a class="code" href="classmqtt_1_1message.html#a3c82927ad233c393b30f28f376b9d1b0">message</a>(<a class="code" href="classmqtt_1_1buffer__ref.html">string_ref</a> <a class="code" href="classmqtt_1_1topic.html">topic</a>, <span class="keyword">const</span> MQTTAsync_message&amp; msg);</div>
<div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;    <a class="code" href="classmqtt_1_1message.html#a3c82927ad233c393b30f28f376b9d1b0">message</a>(<span class="keyword">const</span> <a class="code" href="classmqtt_1_1message.html">message</a>&amp; other);</div>
<div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160;    <a class="code" href="classmqtt_1_1message.html#a3c82927ad233c393b30f28f376b9d1b0">message</a>(<a class="code" href="classmqtt_1_1message.html">message</a>&amp;&amp; other);</div>
<div class="line"><a name="l00153"></a><span class="lineno"><a class="line" href="classmqtt_1_1message.html#ad66d97679cdd8c1f7b22446801295f51">  153</a></span>&#160;    <a class="code" href="classmqtt_1_1message.html#ad66d97679cdd8c1f7b22446801295f51">~message</a>() {}</div>
<div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160;</div>
<div class="line"><a name="l00164"></a><span class="lineno"><a class="line" href="classmqtt_1_1message.html#a3837ff1e6d7ed1227d57fafe1e3618a0">  164</a></span>&#160;    <span class="keyword">static</span> <a class="code" href="classmqtt_1_1message.html#af207327d7802ed7133640d3c18921017">ptr_t</a> <a class="code" href="classmqtt_1_1message.html#a3837ff1e6d7ed1227d57fafe1e3618a0">create</a>(<a class="code" href="classmqtt_1_1buffer__ref.html">string_ref</a> <a class="code" href="classmqtt_1_1topic.html">topic</a>, <span class="keyword">const</span> <span class="keywordtype">void</span>* payload, <span class="keywordtype">size_t</span> len,</div>
<div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160;                        <span class="keywordtype">int</span> qos, <span class="keywordtype">bool</span> retained) {</div>
<div class="line"><a name="l00166"></a><span class="lineno">  166</span>&#160;        <span class="keywordflow">return</span> std::make_shared&lt;message&gt;(std::move(topic), payload, len,</div>
<div class="line"><a name="l00167"></a><span class="lineno">  167</span>&#160;                                         qos, retained);</div>
<div class="line"><a name="l00168"></a><span class="lineno">  168</span>&#160;    }</div>
<div class="line"><a name="l00176"></a><span class="lineno"><a class="line" href="classmqtt_1_1message.html#a3b93c447da0fc38e79f2e3cc3a3d5d4a">  176</a></span>&#160;    <span class="keyword">static</span> <a class="code" href="classmqtt_1_1message.html#af207327d7802ed7133640d3c18921017">ptr_t</a> <a class="code" href="classmqtt_1_1message.html#a3b93c447da0fc38e79f2e3cc3a3d5d4a">create</a>(<a class="code" href="classmqtt_1_1buffer__ref.html">string_ref</a> <a class="code" href="classmqtt_1_1topic.html">topic</a>, <span class="keyword">const</span> <span class="keywordtype">void</span>* payload, <span class="keywordtype">size_t</span> len) {</div>
<div class="line"><a name="l00177"></a><span class="lineno">  177</span>&#160;        <span class="keywordflow">return</span> std::make_shared&lt;message&gt;(std::move(topic), payload, len,</div>
<div class="line"><a name="l00178"></a><span class="lineno">  178</span>&#160;                                         <a class="code" href="classmqtt_1_1message.html#a9689553c0840b987f5aa064b3692e09c">DFLT_QOS</a>, <a class="code" href="classmqtt_1_1message.html#a4130d0db580fb11ee4a476712f000d48">DFLT_RETAINED</a>);</div>
<div class="line"><a name="l00179"></a><span class="lineno">  179</span>&#160;    }</div>
<div class="line"><a name="l00188"></a><span class="lineno"><a class="line" href="classmqtt_1_1message.html#aa4475158717c7334cdeee4601f908910">  188</a></span>&#160;    <span class="keyword">static</span> <a class="code" href="classmqtt_1_1message.html#af207327d7802ed7133640d3c18921017">ptr_t</a> <a class="code" href="classmqtt_1_1message.html#aa4475158717c7334cdeee4601f908910">create</a>(<a class="code" href="classmqtt_1_1buffer__ref.html">string_ref</a> <a class="code" href="classmqtt_1_1topic.html">topic</a>, <a class="code" href="classmqtt_1_1buffer__ref.html">binary_ref</a> payload, <span class="keywordtype">int</span> qos, <span class="keywordtype">bool</span> retained) {</div>
<div class="line"><a name="l00189"></a><span class="lineno">  189</span>&#160;        <span class="keywordflow">return</span> std::make_shared&lt;message&gt;(std::move(topic), std::move(payload),</div>
<div class="line"><a name="l00190"></a><span class="lineno">  190</span>&#160;                                         qos, retained);</div>
<div class="line"><a name="l00191"></a><span class="lineno">  191</span>&#160;    }</div>
<div class="line"><a name="l00198"></a><span class="lineno"><a class="line" href="classmqtt_1_1message.html#af55e31a3894c91da7586d1181285decd">  198</a></span>&#160;    <span class="keyword">static</span> <a class="code" href="classmqtt_1_1message.html#af207327d7802ed7133640d3c18921017">ptr_t</a> <a class="code" href="classmqtt_1_1message.html#af55e31a3894c91da7586d1181285decd">create</a>(<a class="code" href="classmqtt_1_1buffer__ref.html">string_ref</a> <a class="code" href="classmqtt_1_1topic.html">topic</a>, <a class="code" href="classmqtt_1_1buffer__ref.html">binary_ref</a> payload) {</div>
<div class="line"><a name="l00199"></a><span class="lineno">  199</span>&#160;        <span class="keywordflow">return</span> std::make_shared&lt;message&gt;(std::move(topic), std::move(payload),</div>
<div class="line"><a name="l00200"></a><span class="lineno">  200</span>&#160;                                         <a class="code" href="classmqtt_1_1message.html#a9689553c0840b987f5aa064b3692e09c">DFLT_QOS</a>, <a class="code" href="classmqtt_1_1message.html#a4130d0db580fb11ee4a476712f000d48">DFLT_RETAINED</a>);</div>
<div class="line"><a name="l00201"></a><span class="lineno">  201</span>&#160;    }</div>
<div class="line"><a name="l00207"></a><span class="lineno"><a class="line" href="classmqtt_1_1message.html#aff47357d911931406fef240438db891c">  207</a></span>&#160;    <span class="keyword">static</span> <a class="code" href="classmqtt_1_1message.html#af207327d7802ed7133640d3c18921017">ptr_t</a> <a class="code" href="classmqtt_1_1message.html#aff47357d911931406fef240438db891c">create</a>(<a class="code" href="classmqtt_1_1buffer__ref.html">string_ref</a> <a class="code" href="classmqtt_1_1topic.html">topic</a>, <span class="keyword">const</span> MQTTAsync_message&amp; msg) {</div>
<div class="line"><a name="l00208"></a><span class="lineno">  208</span>&#160;        <span class="keywordflow">return</span> std::make_shared&lt;message&gt;(std::move(topic), msg);</div>
<div class="line"><a name="l00209"></a><span class="lineno">  209</span>&#160;    }</div>
<div class="line"><a name="l00215"></a><span class="lineno">  215</span>&#160;    <a class="code" href="classmqtt_1_1message.html">message</a>&amp; <a class="code" href="classmqtt_1_1message.html#ae40dd6ffa3596bcef33b81f8a3995f3f">operator=</a>(<span class="keyword">const</span> <a class="code" href="classmqtt_1_1message.html">message</a>&amp; rhs);</div>
<div class="line"><a name="l00221"></a><span class="lineno">  221</span>&#160;    <a class="code" href="classmqtt_1_1message.html">message</a>&amp; <a class="code" href="classmqtt_1_1message.html#ae40dd6ffa3596bcef33b81f8a3995f3f">operator=</a>(<a class="code" href="classmqtt_1_1message.html">message</a>&amp;&amp; rhs);</div>
<div class="line"><a name="l00226"></a><span class="lineno"><a class="line" href="classmqtt_1_1message.html#a5a46fb7ecf4c687287d459bf6527d3fa">  226</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="classmqtt_1_1message.html#a5a46fb7ecf4c687287d459bf6527d3fa">set_topic</a>(<a class="code" href="classmqtt_1_1buffer__ref.html">string_ref</a> <a class="code" href="classmqtt_1_1topic.html">topic</a>) {</div>
<div class="line"><a name="l00227"></a><span class="lineno">  227</span>&#160;        topic_ = topic_ ? std::move(topic) : <a class="code" href="classmqtt_1_1buffer__ref.html">string_ref</a>(<span class="keywordtype">string</span>());</div>
<div class="line"><a name="l00228"></a><span class="lineno">  228</span>&#160;    }</div>
<div class="line"><a name="l00233"></a><span class="lineno"><a class="line" href="classmqtt_1_1message.html#a3d98dfc2795d3fc101057165cebee888">  233</a></span>&#160;    <span class="keyword">const</span> <a class="code" href="classmqtt_1_1buffer__ref.html">string_ref</a>&amp; <a class="code" href="classmqtt_1_1message.html#a3d98dfc2795d3fc101057165cebee888">get_topic_ref</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> topic_; }</div>
<div class="line"><a name="l00238"></a><span class="lineno"><a class="line" href="classmqtt_1_1message.html#a34e19e65f9653fadb049143d83ed48c7">  238</a></span>&#160;    <span class="keyword">const</span> <span class="keywordtype">string</span>&amp; <a class="code" href="classmqtt_1_1message.html#a34e19e65f9653fadb049143d83ed48c7">get_topic</a>()<span class="keyword"> const </span>{ </div>
<div class="line"><a name="l00239"></a><span class="lineno">  239</span>&#160;        <span class="keywordflow">return</span> topic_ ? topic_.<a class="code" href="classmqtt_1_1buffer__ref.html#ad43932e2a6a5debe8036d6d5af2d76da">str</a>() : EMPTY_STR; </div>
<div class="line"><a name="l00240"></a><span class="lineno">  240</span>&#160;    }</div>
<div class="line"><a name="l00244"></a><span class="lineno">  244</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="classmqtt_1_1message.html#a74ab9515b7f84a9023c61a942a2b2459">clear_payload</a>();</div>
<div class="line"><a name="l00248"></a><span class="lineno"><a class="line" href="classmqtt_1_1message.html#a90935692f470d1671cff83c6726369f8">  248</a></span>&#160;    <span class="keyword">const</span> <a class="code" href="classmqtt_1_1buffer__ref.html">binary_ref</a>&amp; <a class="code" href="classmqtt_1_1message.html#a90935692f470d1671cff83c6726369f8">get_payload_ref</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> payload_; }</div>
<div class="line"><a name="l00252"></a><span class="lineno"><a class="line" href="classmqtt_1_1message.html#a13464c7d9c6c92c10e56292cdfa7da48">  252</a></span>&#160;    <span class="keyword">const</span> binary&amp; <a class="code" href="classmqtt_1_1message.html#a13464c7d9c6c92c10e56292cdfa7da48">get_payload</a>()<span class="keyword"> const </span>{ </div>
<div class="line"><a name="l00253"></a><span class="lineno">  253</span>&#160;        <span class="keywordflow">return</span> payload_ ? payload_.<a class="code" href="classmqtt_1_1buffer__ref.html#ad43932e2a6a5debe8036d6d5af2d76da">str</a>() : EMPTY_BIN; </div>
<div class="line"><a name="l00254"></a><span class="lineno">  254</span>&#160;    }</div>
<div class="line"><a name="l00258"></a><span class="lineno"><a class="line" href="classmqtt_1_1message.html#a6634b9ae09c114eb4b385e91dd85bf11">  258</a></span>&#160;    <span class="keyword">const</span> <span class="keywordtype">string</span>&amp; <a class="code" href="classmqtt_1_1message.html#a6634b9ae09c114eb4b385e91dd85bf11">get_payload_str</a>()<span class="keyword"> const </span>{ </div>
<div class="line"><a name="l00259"></a><span class="lineno">  259</span>&#160;        <span class="keywordflow">return</span> payload_ ? payload_.<a class="code" href="classmqtt_1_1buffer__ref.html#ad43932e2a6a5debe8036d6d5af2d76da">str</a>() : EMPTY_STR;</div>
<div class="line"><a name="l00260"></a><span class="lineno">  260</span>&#160;    }</div>
<div class="line"><a name="l00265"></a><span class="lineno"><a class="line" href="classmqtt_1_1message.html#aacab31d78f9ac17f962d89f9405c0c38">  265</a></span>&#160;    <span class="keywordtype">int</span> <a class="code" href="classmqtt_1_1message.html#aacab31d78f9ac17f962d89f9405c0c38">get_qos</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> msg_.qos; }</div>
<div class="line"><a name="l00272"></a><span class="lineno"><a class="line" href="classmqtt_1_1message.html#ad05a411b58f9b7aad271c2dee0c937f8">  272</a></span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="classmqtt_1_1message.html#ad05a411b58f9b7aad271c2dee0c937f8">is_duplicate</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> to_bool(msg_.dup); }</div>
<div class="line"><a name="l00279"></a><span class="lineno"><a class="line" href="classmqtt_1_1message.html#aa845a148b73a9be79c4e5d09910d36b7">  279</a></span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="classmqtt_1_1message.html#aa845a148b73a9be79c4e5d09910d36b7">is_retained</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> to_bool(msg_.retained); }</div>
<div class="line"><a name="l00287"></a><span class="lineno">  287</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="classmqtt_1_1message.html#a627ceed7e384c159ceb7ed347b1b628b">set_payload</a>(<a class="code" href="classmqtt_1_1buffer__ref.html">binary_ref</a> payload);</div>
<div class="line"><a name="l00293"></a><span class="lineno"><a class="line" href="classmqtt_1_1message.html#ae784b5150baacfaaca319c0ce84ddcb2">  293</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="classmqtt_1_1message.html#ae784b5150baacfaaca319c0ce84ddcb2">set_payload</a>(<span class="keyword">const</span> <span class="keywordtype">void</span>* payload, <span class="keywordtype">size_t</span> n) {</div>
<div class="line"><a name="l00294"></a><span class="lineno">  294</span>&#160;        <a class="code" href="classmqtt_1_1message.html#a627ceed7e384c159ceb7ed347b1b628b">set_payload</a>(<a class="code" href="classmqtt_1_1buffer__ref.html">binary_ref</a>(static_cast&lt;const binary_ref::value_type*&gt;(payload), n));</div>
<div class="line"><a name="l00295"></a><span class="lineno">  295</span>&#160;    }</div>
<div class="line"><a name="l00300"></a><span class="lineno"><a class="line" href="classmqtt_1_1message.html#af666e57c7e68f43e5331f09a843b4262">  300</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="classmqtt_1_1message.html#af666e57c7e68f43e5331f09a843b4262">set_qos</a>(<span class="keywordtype">int</span> qos) {</div>
<div class="line"><a name="l00301"></a><span class="lineno">  301</span>&#160;        <a class="code" href="classmqtt_1_1message.html#a5da9f7a3c9c437069e32f05a933a62aa">validate_qos</a>(qos);</div>
<div class="line"><a name="l00302"></a><span class="lineno">  302</span>&#160;        msg_.qos = qos;</div>
<div class="line"><a name="l00303"></a><span class="lineno">  303</span>&#160;    }</div>
<div class="line"><a name="l00309"></a><span class="lineno"><a class="line" href="classmqtt_1_1message.html#a51c7f7cfe89ebcc17d1686ec025193d2">  309</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="classmqtt_1_1message.html#a51c7f7cfe89ebcc17d1686ec025193d2">set_retained</a>(<span class="keywordtype">bool</span> retained) { msg_.retained = to_int(retained); }</div>
<div class="line"><a name="l00314"></a><span class="lineno"><a class="line" href="classmqtt_1_1message.html#a39a6b9acac26dac99f20d14a30bc91e2">  314</a></span>&#160;    <span class="keywordtype">string</span> <a class="code" href="classmqtt_1_1message.html#a39a6b9acac26dac99f20d14a30bc91e2">to_string</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classmqtt_1_1message.html#a6634b9ae09c114eb4b385e91dd85bf11">get_payload_str</a>(); }</div>
<div class="line"><a name="l00320"></a><span class="lineno"><a class="line" href="classmqtt_1_1message.html#a5da9f7a3c9c437069e32f05a933a62aa">  320</a></span>&#160;    <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classmqtt_1_1message.html#a5da9f7a3c9c437069e32f05a933a62aa">validate_qos</a>(<span class="keywordtype">int</span> qos) {</div>
<div class="line"><a name="l00321"></a><span class="lineno">  321</span>&#160;        <span class="keywordflow">if</span> (qos &lt; 0 || qos &gt; 2)</div>
<div class="line"><a name="l00322"></a><span class="lineno">  322</span>&#160;            <span class="keywordflow">throw</span> <a class="code" href="classmqtt_1_1exception.html">exception</a>(MQTTASYNC_BAD_QOS, <span class="stringliteral">&quot;Bad QoS&quot;</span>);</div>
<div class="line"><a name="l00323"></a><span class="lineno">  323</span>&#160;    }</div>
<div class="line"><a name="l00324"></a><span class="lineno">  324</span>&#160;};</div>
<div class="line"><a name="l00325"></a><span class="lineno">  325</span>&#160;</div>
<div class="line"><a name="l00327"></a><span class="lineno">  327</span>&#160;<span class="keyword">using</span> message_ptr = <a class="code" href="classmqtt_1_1message.html#af207327d7802ed7133640d3c18921017">message::ptr_t</a>;</div>
<div class="line"><a name="l00328"></a><span class="lineno">  328</span>&#160;</div>
<div class="line"><a name="l00330"></a><span class="lineno">  330</span>&#160;<span class="keyword">using</span> const_message_ptr = <a class="code" href="classmqtt_1_1message.html#a99c3bfaaac300457e9678b5d1be30a43">message::const_ptr_t</a>;</div>
<div class="line"><a name="l00331"></a><span class="lineno">  331</span>&#160;</div>
<div class="line"><a name="l00339"></a><span class="lineno">  339</span>&#160;<span class="keyword">inline</span> message_ptr make_message(string_ref topic, <span class="keyword">const</span> <span class="keywordtype">void</span>* payload, <span class="keywordtype">size_t</span> len) {</div>
<div class="line"><a name="l00340"></a><span class="lineno">  340</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="classmqtt_1_1message.html#a3837ff1e6d7ed1227d57fafe1e3618a0">mqtt::message::create</a>(std::move(topic), payload, len);</div>
<div class="line"><a name="l00341"></a><span class="lineno">  341</span>&#160;}</div>
<div class="line"><a name="l00342"></a><span class="lineno">  342</span>&#160;</div>
<div class="line"><a name="l00352"></a><span class="lineno">  352</span>&#160;<span class="keyword">inline</span> message_ptr make_message(string_ref topic, <span class="keyword">const</span> <span class="keywordtype">void</span>* payload, <span class="keywordtype">size_t</span> len,</div>
<div class="line"><a name="l00353"></a><span class="lineno">  353</span>&#160;                                <span class="keywordtype">int</span> qos, <span class="keywordtype">bool</span> retained) {</div>
<div class="line"><a name="l00354"></a><span class="lineno">  354</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="classmqtt_1_1message.html#a3837ff1e6d7ed1227d57fafe1e3618a0">mqtt::message::create</a>(std::move(topic), payload, len, qos, retained);</div>
<div class="line"><a name="l00355"></a><span class="lineno">  355</span>&#160;}</div>
<div class="line"><a name="l00356"></a><span class="lineno">  356</span>&#160;</div>
<div class="line"><a name="l00363"></a><span class="lineno">  363</span>&#160;<span class="keyword">inline</span> message_ptr make_message(string_ref topic, binary_ref payload) {</div>
<div class="line"><a name="l00364"></a><span class="lineno">  364</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="classmqtt_1_1message.html#a3837ff1e6d7ed1227d57fafe1e3618a0">mqtt::message::create</a>(std::move(topic), std::move(payload));</div>
<div class="line"><a name="l00365"></a><span class="lineno">  365</span>&#160;}</div>
<div class="line"><a name="l00366"></a><span class="lineno">  366</span>&#160;</div>
<div class="line"><a name="l00374"></a><span class="lineno">  374</span>&#160;<span class="keyword">inline</span> message_ptr make_message(string_ref topic, binary_ref payload,</div>
<div class="line"><a name="l00375"></a><span class="lineno">  375</span>&#160;                                <span class="keywordtype">int</span> qos, <span class="keywordtype">bool</span> retained) {</div>
<div class="line"><a name="l00376"></a><span class="lineno">  376</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="classmqtt_1_1message.html#a3837ff1e6d7ed1227d57fafe1e3618a0">mqtt::message::create</a>(std::move(topic), std::move(payload), qos, retained);</div>
<div class="line"><a name="l00377"></a><span class="lineno">  377</span>&#160;}</div>
<div class="line"><a name="l00378"></a><span class="lineno">  378</span>&#160;</div>
<div class="line"><a name="l00380"></a><span class="lineno">  380</span>&#160;<span class="comment">// end namespace mqtt</span></div>
<div class="line"><a name="l00381"></a><span class="lineno">  381</span>&#160;}</div>
<div class="line"><a name="l00382"></a><span class="lineno">  382</span>&#160;</div>
<div class="line"><a name="l00383"></a><span class="lineno">  383</span>&#160;<span class="preprocessor">#endif      // __mqtt_message_h</span></div>
<div class="line"><a name="l00384"></a><span class="lineno">  384</span>&#160;<span class="preprocessor"></span></div>
<div class="ttc" id="classmqtt_1_1message_html_a34e19e65f9653fadb049143d83ed48c7"><div class="ttname"><a href="classmqtt_1_1message.html#a34e19e65f9653fadb049143d83ed48c7">mqtt::message::get_topic</a></div><div class="ttdeci">const string &amp; get_topic() const </div><div class="ttdoc">Gets the topic for the message. </div><div class="ttdef"><b>Definition:</b> message.h:238</div></div>
<div class="ttc" id="classmqtt_1_1message_html_ae784b5150baacfaaca319c0ce84ddcb2"><div class="ttname"><a href="classmqtt_1_1message.html#ae784b5150baacfaaca319c0ce84ddcb2">mqtt::message::set_payload</a></div><div class="ttdeci">void set_payload(const void *payload, size_t n)</div><div class="ttdoc">Sets the payload of this message to be the specified byte array. </div><div class="ttdef"><b>Definition:</b> message.h:293</div></div>
<div class="ttc" id="classmqtt_1_1message_html_a5a46fb7ecf4c687287d459bf6527d3fa"><div class="ttname"><a href="classmqtt_1_1message.html#a5a46fb7ecf4c687287d459bf6527d3fa">mqtt::message::set_topic</a></div><div class="ttdeci">void set_topic(string_ref topic)</div><div class="ttdoc">Sets the topic string. </div><div class="ttdef"><b>Definition:</b> message.h:226</div></div>
<div class="ttc" id="classmqtt_1_1async__client_html"><div class="ttname"><a href="classmqtt_1_1async__client.html">mqtt::async_client</a></div><div class="ttdoc">Lightweight client for talking to an MQTT server using non-blocking methods that allow an operation t...</div><div class="ttdef"><b>Definition:</b> async_client.h:60</div></div>
<div class="ttc" id="classmqtt_1_1message_html_af666e57c7e68f43e5331f09a843b4262"><div class="ttname"><a href="classmqtt_1_1message.html#af666e57c7e68f43e5331f09a843b4262">mqtt::message::set_qos</a></div><div class="ttdeci">void set_qos(int qos)</div><div class="ttdoc">Sets the quality of service for this message. </div><div class="ttdef"><b>Definition:</b> message.h:300</div></div>
<div class="ttc" id="classmqtt_1_1message_html_aa4475158717c7334cdeee4601f908910"><div class="ttname"><a href="classmqtt_1_1message.html#aa4475158717c7334cdeee4601f908910">mqtt::message::create</a></div><div class="ttdeci">static ptr_t create(string_ref topic, binary_ref payload, int qos, bool retained)</div><div class="ttdoc">Constructs a message from a byte buffer. </div><div class="ttdef"><b>Definition:</b> message.h:188</div></div>
<div class="ttc" id="classmqtt_1_1message_html_a627ceed7e384c159ceb7ed347b1b628b"><div class="ttname"><a href="classmqtt_1_1message.html#a627ceed7e384c159ceb7ed347b1b628b">mqtt::message::set_payload</a></div><div class="ttdeci">void set_payload(binary_ref payload)</div><div class="ttdoc">Sets the payload of this message to be the specified buffer. </div></div>
<div class="ttc" id="classmqtt_1_1message_html_ad05a411b58f9b7aad271c2dee0c937f8"><div class="ttname"><a href="classmqtt_1_1message.html#ad05a411b58f9b7aad271c2dee0c937f8">mqtt::message::is_duplicate</a></div><div class="ttdeci">bool is_duplicate() const </div><div class="ttdoc">Returns whether or not this message might be a duplicate of one which has already been received...</div><div class="ttdef"><b>Definition:</b> message.h:272</div></div>
<div class="ttc" id="classmqtt_1_1message_html_a39a6b9acac26dac99f20d14a30bc91e2"><div class="ttname"><a href="classmqtt_1_1message.html#a39a6b9acac26dac99f20d14a30bc91e2">mqtt::message::to_string</a></div><div class="ttdeci">string to_string() const </div><div class="ttdoc">Returns a string representation of this messages payload. </div><div class="ttdef"><b>Definition:</b> message.h:314</div></div>
<div class="ttc" id="classmqtt_1_1message_html_aff47357d911931406fef240438db891c"><div class="ttname"><a href="classmqtt_1_1message.html#aff47357d911931406fef240438db891c">mqtt::message::create</a></div><div class="ttdeci">static ptr_t create(string_ref topic, const MQTTAsync_message &amp;msg)</div><div class="ttdoc">Constructs a message as a copy of the C message struct. </div><div class="ttdef"><b>Definition:</b> message.h:207</div></div>
<div class="ttc" id="classmqtt_1_1buffer__ref_html_ad43932e2a6a5debe8036d6d5af2d76da"><div class="ttname"><a href="classmqtt_1_1buffer__ref.html#ad43932e2a6a5debe8036d6d5af2d76da">mqtt::buffer_ref::str</a></div><div class="ttdeci">const blob &amp; str() const </div><div class="ttdoc">Gets the data buffer as a string. </div><div class="ttdef"><b>Definition:</b> buffer_ref.h:246</div></div>
<div class="ttc" id="classmqtt_1_1message_html_a2faf94bc3aaf3d8795d2be0933df7ce4"><div class="ttname"><a href="classmqtt_1_1message.html#a2faf94bc3aaf3d8795d2be0933df7ce4">mqtt::message::message</a></div><div class="ttdeci">message(string_ref topic, const void *payload, size_t len)</div><div class="ttdoc">Constructs a message with the specified array as a payload, and all other values set to defaults...</div><div class="ttdef"><b>Definition:</b> message.h:115</div></div>
<div class="ttc" id="classmqtt_1_1topic_html"><div class="ttname"><a href="classmqtt_1_1topic.html">mqtt::topic</a></div><div class="ttdoc">Represents a topic destination, used for publish/subscribe messaging. </div><div class="ttdef"><b>Definition:</b> topic.h:42</div></div>
<div class="ttc" id="classmqtt_1_1buffer__ref_html"><div class="ttname"><a href="classmqtt_1_1buffer__ref.html">mqtt::buffer_ref&lt; char &gt;</a></div></div>
<div class="ttc" id="classmqtt_1_1message_html_aacab31d78f9ac17f962d89f9405c0c38"><div class="ttname"><a href="classmqtt_1_1message.html#aacab31d78f9ac17f962d89f9405c0c38">mqtt::message::get_qos</a></div><div class="ttdeci">int get_qos() const </div><div class="ttdoc">Returns the quality of service for this message. </div><div class="ttdef"><b>Definition:</b> message.h:265</div></div>
<div class="ttc" id="exception_8h_html"><div class="ttname"><a href="exception_8h.html">exception.h</a></div><div class="ttdoc">Declaration of MQTT exception class. </div></div>
<div class="ttc" id="classmqtt_1_1message_html_a51c7f7cfe89ebcc17d1686ec025193d2"><div class="ttname"><a href="classmqtt_1_1message.html#a51c7f7cfe89ebcc17d1686ec025193d2">mqtt::message::set_retained</a></div><div class="ttdeci">void set_retained(bool retained)</div><div class="ttdoc">Whether or not the publish message should be retained by the broker. </div><div class="ttdef"><b>Definition:</b> message.h:309</div></div>
<div class="ttc" id="classmqtt_1_1message_html_af207327d7802ed7133640d3c18921017"><div class="ttname"><a href="classmqtt_1_1message.html#af207327d7802ed7133640d3c18921017">mqtt::message::ptr_t</a></div><div class="ttdeci">std::shared_ptr&lt; message &gt; ptr_t</div><div class="ttdoc">Smart/shared pointer to this class. </div><div class="ttdef"><b>Definition:</b> message.h:88</div></div>
<div class="ttc" id="classmqtt_1_1message_html_ae40dd6ffa3596bcef33b81f8a3995f3f"><div class="ttname"><a href="classmqtt_1_1message.html#ae40dd6ffa3596bcef33b81f8a3995f3f">mqtt::message::operator=</a></div><div class="ttdeci">message &amp; operator=(const message &amp;rhs)</div><div class="ttdoc">Copies another message to this one. </div></div>
<div class="ttc" id="classmqtt_1_1exception_html"><div class="ttname"><a href="classmqtt_1_1exception.html">mqtt::exception</a></div><div class="ttdoc">Base mqtt::exception. </div><div class="ttdef"><b>Definition:</b> exception.h:42</div></div>
<div class="ttc" id="classmqtt_1_1message_html_a6634b9ae09c114eb4b385e91dd85bf11"><div class="ttname"><a href="classmqtt_1_1message.html#a6634b9ae09c114eb4b385e91dd85bf11">mqtt::message::get_payload_str</a></div><div class="ttdeci">const string &amp; get_payload_str() const </div><div class="ttdoc">Gets the payload as a string. </div><div class="ttdef"><b>Definition:</b> message.h:258</div></div>
<div class="ttc" id="classmqtt_1_1message_html_a0297a011ab9002ab3fe71156db647da7"><div class="ttname"><a href="classmqtt_1_1message.html#a0297a011ab9002ab3fe71156db647da7">mqtt::message::message</a></div><div class="ttdeci">message(string_ref topic, binary_ref payload)</div><div class="ttdoc">Constructs a message from a byte buffer. </div><div class="ttdef"><b>Definition:</b> message.h:132</div></div>
<div class="ttc" id="classmqtt_1_1message_html_a90935692f470d1671cff83c6726369f8"><div class="ttname"><a href="classmqtt_1_1message.html#a90935692f470d1671cff83c6726369f8">mqtt::message::get_payload_ref</a></div><div class="ttdeci">const binary_ref &amp; get_payload_ref() const </div><div class="ttdoc">Gets the payload reference. </div><div class="ttdef"><b>Definition:</b> message.h:248</div></div>
<div class="ttc" id="classmqtt_1_1message_html"><div class="ttname"><a href="classmqtt_1_1message.html">mqtt::message</a></div><div class="ttdoc">An MQTT message holds everything required for an MQTT PUBLISH message. </div><div class="ttdef"><b>Definition:</b> message.h:52</div></div>
<div class="ttc" id="classmqtt_1_1message_html_a3d98dfc2795d3fc101057165cebee888"><div class="ttname"><a href="classmqtt_1_1message.html#a3d98dfc2795d3fc101057165cebee888">mqtt::message::get_topic_ref</a></div><div class="ttdeci">const string_ref &amp; get_topic_ref() const </div><div class="ttdoc">Gets the topic reference for the message. </div><div class="ttdef"><b>Definition:</b> message.h:233</div></div>
<div class="ttc" id="buffer__ref_8h_html"><div class="ttname"><a href="buffer__ref_8h.html">buffer_ref.h</a></div><div class="ttdoc">Buffer reference type for the Paho MQTT C++ library. </div></div>
<div class="ttc" id="classmqtt_1_1message_html_a4130d0db580fb11ee4a476712f000d48"><div class="ttname"><a href="classmqtt_1_1message.html#a4130d0db580fb11ee4a476712f000d48">mqtt::message::DFLT_RETAINED</a></div><div class="ttdeci">static constexpr bool DFLT_RETAINED</div><div class="ttdoc">The default retained flag. </div><div class="ttdef"><b>Definition:</b> message.h:58</div></div>
<div class="ttc" id="classmqtt_1_1message_html_ad66d97679cdd8c1f7b22446801295f51"><div class="ttname"><a href="classmqtt_1_1message.html#ad66d97679cdd8c1f7b22446801295f51">mqtt::message::~message</a></div><div class="ttdeci">~message()</div><div class="ttdoc">Destroys a message and frees all associated resources. </div><div class="ttdef"><b>Definition:</b> message.h:153</div></div>
<div class="ttc" id="classmqtt_1_1message_html_a3b93c447da0fc38e79f2e3cc3a3d5d4a"><div class="ttname"><a href="classmqtt_1_1message.html#a3b93c447da0fc38e79f2e3cc3a3d5d4a">mqtt::message::create</a></div><div class="ttdeci">static ptr_t create(string_ref topic, const void *payload, size_t len)</div><div class="ttdoc">Constructs a message with the specified array as a payload, and all other values set to defaults...</div><div class="ttdef"><b>Definition:</b> message.h:176</div></div>
<div class="ttc" id="classmqtt_1_1message_html_aa845a148b73a9be79c4e5d09910d36b7"><div class="ttname"><a href="classmqtt_1_1message.html#aa845a148b73a9be79c4e5d09910d36b7">mqtt::message::is_retained</a></div><div class="ttdeci">bool is_retained() const </div><div class="ttdoc">Returns whether or not this message should be/was retained by the server. </div><div class="ttdef"><b>Definition:</b> message.h:279</div></div>
<div class="ttc" id="classmqtt_1_1message_html_a5da9f7a3c9c437069e32f05a933a62aa"><div class="ttname"><a href="classmqtt_1_1message.html#a5da9f7a3c9c437069e32f05a933a62aa">mqtt::message::validate_qos</a></div><div class="ttdeci">static void validate_qos(int qos)</div><div class="ttdoc">Determines if the QOS value is a valid one. </div><div class="ttdef"><b>Definition:</b> message.h:320</div></div>
<div class="ttc" id="classmqtt_1_1message_html_a13464c7d9c6c92c10e56292cdfa7da48"><div class="ttname"><a href="classmqtt_1_1message.html#a13464c7d9c6c92c10e56292cdfa7da48">mqtt::message::get_payload</a></div><div class="ttdeci">const binary &amp; get_payload() const </div><div class="ttdoc">Gets the payload. </div><div class="ttdef"><b>Definition:</b> message.h:252</div></div>
<div class="ttc" id="classmqtt_1_1message_html_af55e31a3894c91da7586d1181285decd"><div class="ttname"><a href="classmqtt_1_1message.html#af55e31a3894c91da7586d1181285decd">mqtt::message::create</a></div><div class="ttdeci">static ptr_t create(string_ref topic, binary_ref payload)</div><div class="ttdoc">Constructs a message from a byte buffer. </div><div class="ttdef"><b>Definition:</b> message.h:198</div></div>
<div class="ttc" id="classmqtt_1_1message_html_a3c82927ad233c393b30f28f376b9d1b0"><div class="ttname"><a href="classmqtt_1_1message.html#a3c82927ad233c393b30f28f376b9d1b0">mqtt::message::message</a></div><div class="ttdeci">message()</div><div class="ttdoc">Constructs a message with an empty payload, and all other values set to defaults. ...</div></div>
<div class="ttc" id="classmqtt_1_1message_html_a9689553c0840b987f5aa064b3692e09c"><div class="ttname"><a href="classmqtt_1_1message.html#a9689553c0840b987f5aa064b3692e09c">mqtt::message::DFLT_QOS</a></div><div class="ttdeci">static constexpr int DFLT_QOS</div><div class="ttdoc">The default QoS for a message. </div><div class="ttdef"><b>Definition:</b> message.h:56</div></div>
<div class="ttc" id="classmqtt_1_1message_html_a3837ff1e6d7ed1227d57fafe1e3618a0"><div class="ttname"><a href="classmqtt_1_1message.html#a3837ff1e6d7ed1227d57fafe1e3618a0">mqtt::message::create</a></div><div class="ttdeci">static ptr_t create(string_ref topic, const void *payload, size_t len, int qos, bool retained)</div><div class="ttdoc">Constructs a message with the specified array as a payload, and all other values set to defaults...</div><div class="ttdef"><b>Definition:</b> message.h:164</div></div>
<div class="ttc" id="classmqtt_1_1message_html_a99c3bfaaac300457e9678b5d1be30a43"><div class="ttname"><a href="classmqtt_1_1message.html#a99c3bfaaac300457e9678b5d1be30a43">mqtt::message::const_ptr_t</a></div><div class="ttdeci">std::shared_ptr&lt; const message &gt; const_ptr_t</div><div class="ttdoc">Smart/shared pointer to this class. </div><div class="ttdef"><b>Definition:</b> message.h:90</div></div>
<div class="ttc" id="classmqtt_1_1message_html_a74ab9515b7f84a9023c61a942a2b2459"><div class="ttname"><a href="classmqtt_1_1message.html#a74ab9515b7f84a9023c61a942a2b2459">mqtt::message::clear_payload</a></div><div class="ttdeci">void clear_payload()</div><div class="ttdoc">Clears the payload, resetting it to be empty. </div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_503ebd9f384f44c9859dcb1451d026bc.html">mqtt</a></li><li class="navelem"><a class="el" href="message_8h.html">message.h</a></li>
    <li class="footer">Generated on Sun Jul 23 2017 10:24:29 for Paho C++ by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.6 </li>
  </ul>
</div>
</body>
</html>
